home *** CD-ROM | disk | FTP | other *** search
/ Aminet 30 / Aminet 30 (1999)(Schatztruhe)[!][Apr 1999].iso / Aminet / dev / misc / WHDLoad_dev.lha / WHDLoad / Install < prev    next >
Text File  |  1998-05-25  |  4KB  |  154 lines

  1. ;----------------------------
  2. ; Check version and install if newer
  3. ; IN:    #source-file
  4. ;    #dest-file
  5.  
  6. (procedure P_install
  7.   (set #sver (getversion #source-file))
  8.   (if
  9.     (exists #dest-file)
  10.     (set #dver (getversion #dest-file))
  11.     (set #dver 0)
  12.   )
  13.   (if
  14.     (< #sver #dver)
  15.     (abort
  16.       "The installation has determinated that the already installed program"
  17.       ("\"%s\" has a newer version than the program to install." #source-file)
  18.       "The current WHDLoad package seems to be outdated. Therefore the"
  19.       "installation will be canceled. Please try to get a newer version of"
  20.       "the WHDLoad package."
  21.     )
  22.   )
  23.   (set #prompt ("\nNow installing the program\n\n\"%s\" with version %ld.%ld\n\n" (fileonly #source-file) (/ #sver 65536) (BITAND #sver 65535)))
  24.   (if
  25.     (> #dver 0)
  26.     (set #prompt ("%sby overwriting\n\n\"%s\" with version %ld.%ld" #prompt #dest-file (/ #dver 65536) (BITAND #dver 65535)))
  27.     (set #prompt ("%sinto the directory\n\n\"%s\"" #prompt (pathonly #dest-file)))
  28.   )
  29.   (if
  30.     (= @user-level 2)
  31.     (set #choice
  32.       (askbool
  33.         (prompt #prompt)
  34.         (default 1)
  35.         (choices "Install" "Skip")
  36.         (help @askbool-help)
  37.       )
  38.     )
  39.     (set #choice 1)
  40.   )
  41.   (if
  42.     (= #choice 1)
  43.     (copyfiles
  44.       (help @copyfiles-help)
  45.       (source #source-file)
  46.       (dest (pathonly #dest-file))
  47.       (newname (fileonly #dest-file))
  48.     )
  49.   )
  50. )
  51.  
  52. ;----------------------------
  53.  
  54. (if
  55.   (exists "C/InstallBB")
  56.   (set #mode "dev")
  57.   (set #mode "usr")
  58. )
  59.  
  60. (if
  61.   (= #mode "dev")
  62.   (welcome
  63.     "Welcome to the WHDLoad installation.\n"
  64.     "This script will copy all files which need a special location to their recommend places.\n"
  65.     "All other files like the source examples and the Install Templates will not copied."
  66.     "Therefore it is recommend to move this drawer yourself to your prefered location.\n"
  67.     "If you don't want to install all provided programs, please select the expert mode where you can skip these programs."
  68.   )
  69.   (welcome
  70.     "Welcome to the WHDLoad installation."
  71.   )
  72. )
  73.  
  74. (set @default-dest
  75.   (askdir
  76.     (prompt "Where should WHDLoad and the other tools installed ?\nThe location must be reachable via the path !\nRecommend is \"C:\".")
  77.     (help @askdir-help)
  78.     (default "C:")
  79.     (disk)
  80.   )
  81. )
  82.  
  83. (set #path "C")
  84. (foreach #path "#?"
  85.   (set #file @each-name)
  86.   (set #source-file (tackon #path #file))
  87.   (set #dest-file   (tackon @default-dest #file))
  88.   (P_install)
  89. )
  90.  
  91. (if
  92.   (= #mode "dev")
  93.   (
  94.     (set #dest
  95.       (askdir
  96.         (prompt "Where should the include file \"whdload.i\" installed ?")
  97.         (help @askdir-help)
  98.         (default "Includes:")
  99.       )
  100.     )
  101.     (copyfiles
  102.       (help @copyfiles-help)
  103.       (source "include/whdload.i")
  104.       (dest #dest)
  105.     )
  106.     (set #dest
  107.       (askdir
  108.         (prompt "Where should the autodoc file \"whdload.doc\" installed ?")
  109.         (help @askdir-help)
  110.         (default "Autodocs:")
  111.       )
  112.     )
  113.     (copyfiles
  114.       (help @copyfiles-help)
  115.       (source "autodoc/whdload.doc")
  116.       (dest #dest)
  117.     )
  118.     (exit
  119.       "\n"
  120.       "Installation is complete.\n"
  121.       "\n"
  122.       "All files which need a special location has been copied.\n"
  123.       "Please move all other files yourself to your prefered place."
  124.       "\n"
  125.       "Hope it will be useful for you."
  126.       (quiet)
  127.     )
  128.   )
  129.   (
  130.     (set #dest
  131.       (askdir
  132.         (prompt "Where should the documentation for WHDLoad installed ?\nA drawer WHDLoad will be created there.")
  133.         (help @askdir-help)
  134.         (default "Help:")
  135.       )
  136.     )
  137.     (copyfiles
  138.       (help @copyfiles-help)
  139.       (source "Docs")
  140.       (dest (tackon #dest "WHDLoad"))
  141.       (all)
  142.       (infos)
  143.     )
  144.     (exit
  145.       "\n"
  146.       "Installation is now complete.\n"
  147.       "Please read the documentation carefully on how to use and configure WHDLoad for your needs."
  148.       (quiet)
  149.     )
  150.   )
  151. )
  152.  
  153.  
  154.